databaseChangeLog = {

	changeSet(author: "pablo (generated)", id: "1316270774455-1") {
		createTable(tableName: "afiliado") {
			column(name: "id", type: "int8") {
				constraints(nullable: "false", primaryKey: "true", primaryKeyName: "afiliado_pkey")
			}

			column(name: "version", type: "int8") {
				constraints(nullable: "false")
			}

			column(name: "apellido_nombre", type: "VARCHAR(255)") {
				constraints(nullable: "false")
			}

			column(name: "banco", type: "VARCHAR(255)")

			column(name: "calle", type: "VARCHAR(255)")

			column(name: "categoria", type: "VARCHAR(255)")

			column(name: "cbu", type: "VARCHAR(255)")

			column(name: "celular", type: "VARCHAR(255)")

			column(name: "codigo_postal", type: "VARCHAR(255)")

			column(name: "cuil", type: "VARCHAR(255)")

			column(name: "delegado_id", type: "int8")

			column(name: "departamento", type: "VARCHAR(255)")

			column(name: "dependencia_id", type: "int8")

			column(name: "dni", type: "VARCHAR(255)")

			column(name: "email", type: "VARCHAR(255)")

			column(name: "empresa_id", type: "int8")

			column(name: "es_delegado", type: "bool") {
				constraints(nullable: "false")
			}

			column(name: "estado", type: "VARCHAR(255)") {
				constraints(nullable: "false")
			}

			column(name: "estado_civil", type: "VARCHAR(12)")

			column(name: "fecha_afiliacion", type: "TIMESTAMP WITH TIME ZONE")

			column(name: "fecha_ingreso", type: "TIMESTAMP WITH TIME ZONE")

			column(name: "fecha_nacimiento", type: "TIMESTAMP WITH TIME ZONE")

			column(name: "legajo", type: "VARCHAR(255)") {
				constraints(nullable: "false")
			}

			column(name: "localidad", type: "VARCHAR(255)")

			column(name: "lugar_trabajo_id", type: "int8")

			column(name: "mes_nacimiento", type: "VARCHAR(255)")

			column(name: "numero", type: "VARCHAR(255)")

			column(name: "numero_cuenta", type: "VARCHAR(255)")

			column(name: "observaciones", type: "VARCHAR(255)")

			column(name: "piso", type: "VARCHAR(255)")

			column(name: "sexo", type: "VARCHAR(9)")

			column(name: "sucursal", type: "VARCHAR(255)")

			column(name: "telefono", type: "VARCHAR(255)")
		}
	}

	changeSet(author: "pablo (generated)", id: "1316270774455-2") {
		createTable(tableName: "configuracion") {
			column(name: "id", type: "int8") {
				constraints(nullable: "false", primaryKey: "true", primaryKeyName: "configuracion_pkey")
			}

			column(name: "version", type: "int8") {
				constraints(nullable: "false")
			}

			column(name: "porc_subsidio", type: "int4") {
				constraints(nullable: "false")
			}
		}
	}

	changeSet(author: "pablo (generated)", id: "1316270774455-3") {
		createTable(tableName: "consumo") {
			column(name: "id", type: "int8") {
				constraints(nullable: "false", primaryKey: "true", primaryKeyName: "consumo_pkey")
			}

			column(name: "version", type: "int8") {
				constraints(nullable: "false")
			}

			column(name: "afiliado_id", type: "int8") {
				constraints(nullable: "false")
			}

			column(name: "cant_cuotas", type: "int4") {
				constraints(nullable: "false")
			}

			column(name: "estado", type: "VARCHAR(255)") {
				constraints(nullable: "false")
			}

			column(name: "fecha", type: "TIMESTAMP WITH TIME ZONE") {
				constraints(nullable: "false")
			}

			column(name: "monto", type: "FLOAT8(17)") {
				constraints(nullable: "false")
			}

			column(name: "nro_cuota", type: "int4") {
				constraints(nullable: "false")
			}

			column(name: "observaciones", type: "VARCHAR(255)") {
				constraints(nullable: "false")
			}

			column(name: "prestamo_id", type: "int8")

			column(name: "proveedor_id", type: "int8") {
				constraints(nullable: "false")
			}

			column(name: "class", type: "VARCHAR(255)") {
				constraints(nullable: "false")
			}

			column(name: "a_cargo_afiliado", type: "FLOAT8(17)")

			column(name: "subsidio", type: "FLOAT8(17)")

			column(name: "tipo", type: "VARCHAR(255)")
		}
	}

	changeSet(author: "pablo (generated)", id: "1316270774455-4") {
		createTable(tableName: "credito") {
			column(name: "id", type: "int8") {
				constraints(nullable: "false", primaryKey: "true", primaryKeyName: "credito_pkey")
			}

			column(name: "version", type: "int8") {
				constraints(nullable: "false")
			}

			column(name: "class", type: "VARCHAR(255)") {
				constraints(nullable: "false")
			}

			column(name: "afiliado_id", type: "int8")

			column(name: "cantidad_cuotas", type: "int4")

			column(name: "fecha_otorgamiento", type: "TIMESTAMP WITH TIME ZONE")

			column(name: "fecha_pago", type: "TIMESTAMP WITH TIME ZONE")

			column(name: "monto_cuota", type: "FLOAT8(17)")

			column(name: "monto_total", type: "FLOAT8(17)")

			column(name: "observaciones", type: "VARCHAR(255)")

			column(name: "pendiente", type: "FLOAT8(17)")

			column(name: "entrego", type: "VARCHAR(255)")

			column(name: "estado", type: "VARCHAR(255)")

			column(name: "fecha_pedido", type: "TIMESTAMP WITH TIME ZONE")

			column(name: "prestamo_id", type: "int8")
		}
	}

	changeSet(author: "pablo (generated)", id: "1316270774455-5") {
		createTable(tableName: "cuota") {
			column(name: "id", type: "int8") {
				constraints(nullable: "false", primaryKey: "true", primaryKeyName: "cuota_pkey")
			}

			column(name: "version", type: "int8") {
				constraints(nullable: "false")
			}

			column(name: "credito_id", type: "int8") {
				constraints(nullable: "false")
			}

			column(name: "fecha_vencimiento", type: "TIMESTAMP WITH TIME ZONE") {
				constraints(nullable: "false")
			}

			column(name: "cuota_index", type: "int4") {
				constraints(nullable: "false")
			}

			column(name: "is_pagada", type: "bool") {
				constraints(nullable: "false")
			}

			column(name: "monto", type: "FLOAT8(17)") {
				constraints(nullable: "false")
			}

			column(name: "numero", type: "int4") {
				constraints(nullable: "false")
			}

			column(name: "cuotas_idx", type: "int4")
		}
	}

	changeSet(author: "pablo (generated)", id: "1316270774455-6") {
		createTable(tableName: "dependencia") {
			column(name: "id", type: "int8") {
				constraints(nullable: "false", primaryKey: "true", primaryKeyName: "dependencia_pkey")
			}

			column(name: "version", type: "int8") {
				constraints(nullable: "false")
			}

			column(name: "dependencia_index", type: "int4") {
				constraints(nullable: "false")
			}

			column(name: "lugar_trabajo_id", type: "int8") {
				constraints(nullable: "false")
			}

			column(name: "nombre", type: "VARCHAR(255)") {
				constraints(nullable: "false")
			}

			column(name: "dependencias_idx", type: "int4")
		}
	}

	changeSet(author: "pablo (generated)", id: "1316270774455-7") {
		createTable(tableName: "empresa") {
			column(name: "id", type: "int8") {
				constraints(nullable: "false", primaryKey: "true", primaryKeyName: "empresa_pkey")
			}

			column(name: "version", type: "int8") {
				constraints(nullable: "false")
			}

			column(name: "nombre", type: "VARCHAR(255)") {
				constraints(nullable: "false")
			}
		}
	}

	changeSet(author: "pablo (generated)", id: "1316270774455-8") {
		createTable(tableName: "familiar") {
			column(name: "id", type: "int8") {
				constraints(nullable: "false", primaryKey: "true", primaryKeyName: "familiar_pkey")
			}

			column(name: "version", type: "int8") {
				constraints(nullable: "false")
			}

			column(name: "afiliado_id", type: "int8") {
				constraints(nullable: "false")
			}

			column(name: "dni", type: "VARCHAR(255)")

			column(name: "fecha_nacimiento", type: "TIMESTAMP WITH TIME ZONE")

			column(name: "familiar_index", type: "int4") {
				constraints(nullable: "false")
			}

			column(name: "nombre_apellido", type: "VARCHAR(255)") {
				constraints(nullable: "false")
			}

			column(name: "sexo", type: "VARCHAR(255)")

			column(name: "tipo", type: "VARCHAR(16)")

			column(name: "familiars_idx", type: "int4")
		}
	}

	changeSet(author: "pablo (generated)", id: "1316270774455-9") {
		createTable(tableName: "lugar_trabajo") {
			column(name: "id", type: "int8") {
				constraints(nullable: "false", primaryKey: "true", primaryKeyName: "lugar_trabajo_pkey")
			}

			column(name: "version", type: "int8") {
				constraints(nullable: "false")
			}

			column(name: "codigo", type: "VARCHAR(255)") {
				constraints(nullable: "false")
			}

			column(name: "direccion", type: "VARCHAR(255)")

			column(name: "nombre", type: "VARCHAR(255)") {
				constraints(nullable: "false")
			}
		}
	}

	changeSet(author: "pablo (generated)", id: "1316270774455-10") {
		createTable(tableName: "proveedor") {
			column(name: "id", type: "int8") {
				constraints(nullable: "false", primaryKey: "true", primaryKeyName: "proveedor_pkey")
			}

			column(name: "version", type: "int8") {
				constraints(nullable: "false")
			}

			column(name: "comision", type: "FLOAT8(17)") {
				constraints(nullable: "false")
			}

			column(name: "contacto", type: "VARCHAR(255)") {
				constraints(nullable: "false")
			}

			column(name: "direccion", type: "VARCHAR(255)") {
				constraints(nullable: "false")
			}

			column(name: "email", type: "VARCHAR(255)")

			column(name: "nombre", type: "VARCHAR(255)") {
				constraints(nullable: "false")
			}

			column(name: "rubro_id", type: "int8") {
				constraints(nullable: "false")
			}

			column(name: "telefonos", type: "VARCHAR(255)") {
				constraints(nullable: "false")
			}
		}
	}

	changeSet(author: "pablo (generated)", id: "1316270774455-11") {
		createTable(tableName: "rubro") {
			column(name: "id", type: "int8") {
				constraints(nullable: "false", primaryKey: "true", primaryKeyName: "rubro_pkey")
			}

			column(name: "version", type: "int8") {
				constraints(nullable: "false")
			}

			column(name: "codigo", type: "VARCHAR(255)") {
				constraints(nullable: "false")
			}

			column(name: "nombre", type: "VARCHAR(255)") {
				constraints(nullable: "false")
			}
		}
	}

	changeSet(author: "pablo (generated)", id: "1316270774455-12") {
		addUniqueConstraint(columnNames: "legajo", constraintName: "afiliado_legajo_key", deferrable: "false", disabled: "false", initiallyDeferred: "false", tableName: "afiliado")
	}

	changeSet(author: "pablo (generated)", id: "1316270774455-13") {
		addUniqueConstraint(columnNames: "codigo", constraintName: "lugar_trabajo_codigo_key", deferrable: "false", disabled: "false", initiallyDeferred: "false", tableName: "lugar_trabajo")
	}

	changeSet(author: "pablo (generated)", id: "1316270774455-14") {
		addForeignKeyConstraint(baseColumnNames: "delegado_id", baseTableName: "afiliado", baseTableSchemaName: "public", constraintName: "fk295d93ab489c0c07", deferrable: "false", initiallyDeferred: "false", onDelete: "NO ACTION", onUpdate: "NO ACTION", referencedColumnNames: "id", referencedTableName: "afiliado", referencedTableSchemaName: "public", referencesUniqueColumn: "false")
	}

	changeSet(author: "pablo (generated)", id: "1316270774455-15") {
		addForeignKeyConstraint(baseColumnNames: "dependencia_id", baseTableName: "afiliado", baseTableSchemaName: "public", constraintName: "fk295d93ab798851b9", deferrable: "false", initiallyDeferred: "false", onDelete: "NO ACTION", onUpdate: "NO ACTION", referencedColumnNames: "id", referencedTableName: "dependencia", referencedTableSchemaName: "public", referencesUniqueColumn: "false")
	}

	changeSet(author: "pablo (generated)", id: "1316270774455-16") {
		addForeignKeyConstraint(baseColumnNames: "empresa_id", baseTableName: "afiliado", baseTableSchemaName: "public", constraintName: "fk295d93abd600e659", deferrable: "false", initiallyDeferred: "false", onDelete: "NO ACTION", onUpdate: "NO ACTION", referencedColumnNames: "id", referencedTableName: "empresa", referencedTableSchemaName: "public", referencesUniqueColumn: "false")
	}

	changeSet(author: "pablo (generated)", id: "1316270774455-17") {
		addForeignKeyConstraint(baseColumnNames: "lugar_trabajo_id", baseTableName: "afiliado", baseTableSchemaName: "public", constraintName: "fk295d93ab9baeec5c", deferrable: "false", initiallyDeferred: "false", onDelete: "NO ACTION", onUpdate: "NO ACTION", referencedColumnNames: "id", referencedTableName: "lugar_trabajo", referencedTableSchemaName: "public", referencesUniqueColumn: "false")
	}

	changeSet(author: "pablo (generated)", id: "1316270774455-18") {
		addForeignKeyConstraint(baseColumnNames: "afiliado_id", baseTableName: "consumo", baseTableSchemaName: "public", constraintName: "fk38b6fc0625ec87b", deferrable: "false", initiallyDeferred: "false", onDelete: "NO ACTION", onUpdate: "NO ACTION", referencedColumnNames: "id", referencedTableName: "afiliado", referencedTableSchemaName: "public", referencesUniqueColumn: "false")
	}

	changeSet(author: "pablo (generated)", id: "1316270774455-19") {
		addForeignKeyConstraint(baseColumnNames: "prestamo_id", baseTableName: "consumo", baseTableSchemaName: "public", constraintName: "fk38b6fc06864117fb", deferrable: "false", initiallyDeferred: "false", onDelete: "NO ACTION", onUpdate: "NO ACTION", referencedColumnNames: "id", referencedTableName: "credito", referencedTableSchemaName: "public", referencesUniqueColumn: "false")
	}

	changeSet(author: "pablo (generated)", id: "1316270774455-20") {
		addForeignKeyConstraint(baseColumnNames: "proveedor_id", baseTableName: "consumo", baseTableSchemaName: "public", constraintName: "fk38b6fc064cecf679", deferrable: "false", initiallyDeferred: "false", onDelete: "NO ACTION", onUpdate: "NO ACTION", referencedColumnNames: "id", referencedTableName: "proveedor", referencedTableSchemaName: "public", referencesUniqueColumn: "false")
	}

	changeSet(author: "pablo (generated)", id: "1316270774455-21") {
		addForeignKeyConstraint(baseColumnNames: "afiliado_id", baseTableName: "credito", baseTableSchemaName: "public", constraintName: "fk3d4fb49625ec87b", deferrable: "false", initiallyDeferred: "false", onDelete: "NO ACTION", onUpdate: "NO ACTION", referencedColumnNames: "id", referencedTableName: "afiliado", referencedTableSchemaName: "public", referencesUniqueColumn: "false")
	}

	changeSet(author: "pablo (generated)", id: "1316270774455-22") {
		addForeignKeyConstraint(baseColumnNames: "prestamo_id", baseTableName: "credito", baseTableSchemaName: "public", constraintName: "fk3d4fb496864117fb", deferrable: "false", initiallyDeferred: "false", onDelete: "NO ACTION", onUpdate: "NO ACTION", referencedColumnNames: "id", referencedTableName: "credito", referencedTableSchemaName: "public", referencesUniqueColumn: "false")
	}

	changeSet(author: "pablo (generated)", id: "1316270774455-23") {
		addForeignKeyConstraint(baseColumnNames: "credito_id", baseTableName: "cuota", baseTableSchemaName: "public", constraintName: "fk5a9f56a1c824f39", deferrable: "false", initiallyDeferred: "false", onDelete: "NO ACTION", onUpdate: "NO ACTION", referencedColumnNames: "id", referencedTableName: "credito", referencedTableSchemaName: "public", referencesUniqueColumn: "false")
	}

	changeSet(author: "pablo (generated)", id: "1316270774455-24") {
		addForeignKeyConstraint(baseColumnNames: "lugar_trabajo_id", baseTableName: "dependencia", baseTableSchemaName: "public", constraintName: "fkcf6b94869baeec5c", deferrable: "false", initiallyDeferred: "false", onDelete: "NO ACTION", onUpdate: "NO ACTION", referencedColumnNames: "id", referencedTableName: "lugar_trabajo", referencedTableSchemaName: "public", referencesUniqueColumn: "false")
	}

	changeSet(author: "pablo (generated)", id: "1316270774455-25") {
		addForeignKeyConstraint(baseColumnNames: "afiliado_id", baseTableName: "familiar", baseTableSchemaName: "public", constraintName: "fk2eeee28525ec87b", deferrable: "false", initiallyDeferred: "false", onDelete: "NO ACTION", onUpdate: "NO ACTION", referencedColumnNames: "id", referencedTableName: "afiliado", referencedTableSchemaName: "public", referencesUniqueColumn: "false")
	}

	changeSet(author: "pablo (generated)", id: "1316270774455-26") {
		addForeignKeyConstraint(baseColumnNames: "rubro_id", baseTableName: "proveedor", baseTableSchemaName: "public", constraintName: "fkdf24cade7712f139", deferrable: "false", initiallyDeferred: "false", onDelete: "NO ACTION", onUpdate: "NO ACTION", referencedColumnNames: "id", referencedTableName: "rubro", referencedTableSchemaName: "public", referencesUniqueColumn: "false")
	}

	changeSet(author: "pablo (generated)", id: "1316270774455-27") {
		createSequence(schemaName: "public", sequenceName: "hibernate_sequence")
	}
}
